//
//  ZTStringParser.h
//  ZHYYTool
//
//  Created by MT-SW-005 on 2021/11/8.
//  Copyright © 2021 MT-SW-005. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface ZTStringParser : NSObject

/** //////////////////////////////////////////////////////////// trim string  //////////////////////////////////////////////////////////////////////////////// */

/**
 去除字符串首尾的空格
 */
+(NSString*)trimSpace:(NSString*)aString;


/**
 + (NSCharacterSet *)controlCharacterSet;
 + (NSCharacterSet *)whitespaceCharacterSet;
 + (NSCharacterSet *)whitespaceAndNewlineCharacterSet;
 + (NSCharacterSet *)decimalDigitCharacterSet;
 + (NSCharacterSet *)letterCharacterSet;
 + (NSCharacterSet *)lowercaseLetterCharacterSet;
 + (NSCharacterSet *)uppercaseLetterCharacterSet;
 + (NSCharacterSet *)nonBaseCharacterSet;
 + (NSCharacterSet *)alphanumericCharacterSet;
 + (NSCharacterSet *)decomposableCharacterSet;
 + (NSCharacterSet *)illegalCharacterSet;
 + (NSCharacterSet *)punctuationCharacterSet;
 + (NSCharacterSet *)capitalizedLetterCharacterSet;
 + (NSCharacterSet *)symbolCharacterSet;
 + (NSCharacterSet *)newlineCharacterSet NS_AVAILABLE(10_5, 2_0);
 */
+(NSString*)trimString:(NSString*)aString withCharacterSet:(NSCharacterSet*)characterSet;

/**
 去除字符串首尾的:@／：；（）¥「」＂、[]{}#%-*+=_\\|~＜＞$€^•'@#$%^&*()_+'\"
 */
+(NSString*)trimString:(NSString*)aString;


/*
 C语言字符串转化成OC字符串
 */
+(NSString*)charToString:(char*)cStr;

/*
 OC语言字符串转化成C字符串
 */
+ (const char*)stringToChar:(NSString*)aString;

/*
从url中获取字符串
*/
+(NSString*)readStringFromURL:(NSString*)aurl;

/*
从文件中获取字符串
*/
+(NSString*)readStringFromFile:(NSString*)filePath;

/*
获取子串
*/
+(NSString*)subStringFromIndexToEnd:(NSString*)aString index:(NSInteger)anIndex;

/*
获取子串
*/
+(NSString*)subStringFromStartToIndex:(NSString*)aString index:(NSInteger)anIndex;

/*
获取子串
*/
+(NSString*)subStringFromStart:(NSString*)aString  startIndex:(NSInteger)start length:(NSInteger)len;


/*
 替换字符串
 */
+(NSString*)replaceString:(NSString*)aString  originString:(NSString*)anOriginString byString:(NSString*)replaceString;

/*
分割字符串为数组
*/
+(NSArray *)separatString:(NSString*)aString byString:(NSString*)split;

/*
把数组合并为字符串，通过分隔符合并
*/
+(NSString *)joinStringFormArray:(NSArray*)arr byString:(nullable NSString*)split;

@end

NS_ASSUME_NONNULL_END
